package com.homework.demo1;

import java.util.Scanner;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/21 17:17
 * @description
 */
public class Test {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Dao dao = new Dao();
        while (true) {
            System.out.println("=======企业人事管理系统=======");
            System.out.println("1.创建部门\n" +
                    "2.添加员工\n" +
                    "3.查询所有的员工信息和所在的部门信息\n" +
                    "4.修改员工薪资\n" +
                    "5.查询部门中所有员工\n" +
                    "6.退出系统");
            System.out.println("==========================");
            System.out.println("请输入菜单选项：(1-6)");
            int next = input.nextInt();
            switch (next){
                case 1:
                    dao.addDept();
                    break;
                case 2:
                    dao.addEmp();
                    break;
                case 3:
                    dao.findAll();
                    break;
                case 4:
                    dao.editEmpforId();
                    break;
                case 5:
                    dao.findEmpforDid();
                    break;
                case 6:
                    System.out.println("===========已退出==========");
                    return;
            }
        }
    }

}
